import os, shutil

def clean_pychache():
    for root, dirs, files in os.walk('.'):
        for dir in dirs:
            if  dir == '__pycache__' or dir == '.pytest_cache':
                shutil.rmtree(os.path.join(root,dir))

if __name__ == '__main__':
    clean_pychache()